<ui:composition
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
    <h:form id="form">
        <center> <h4><h:outputText value="Liste des Utilisateurs" style="font-family: Bell MT;color:#BF3F5E;"/></h4></center>
        <h:panelGrid style="height: 15px">
            <h:column>
                <p:commandButton value="nouveau" oncomplete="newUserDialog.show()" icon="ui-icon-star" title="creer nouveau utilisateur" style="font-family: Bell MT;"/>
                <p:commandButton value="supprimer" actionListener="#{homeController.mock}" update="dataTable" icon="ui-icon-trash" style="font-family: Bell MT;"/>
            </h:column>
        </h:panelGrid>

        <p:dataTable id="dataTable" var="user" value="#{homeController.users}" styleClass="userDataTableStyle" style="font-family: Bell MT;"
                     paginator="true" rows="9" rowKey="#{user.login}" selection="#{homeController.user}"
                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                     lazy="true" rowsPerPageTemplate="10,15,50">
            <p:ajax event="rowSelect" immediate="true" update=":formLead:panelMain" listener="#{leadController.onRowSelect}"/>
            <p:column selectionMode="single" style="width:18px" />
            <p:column filterBy="#{user.login}"  sortBy="#{user.login}">
                <f:facet name="header">
                    <h:outputText value="Login" style="font-family: Bell MT;" />
                </f:facet>
                <p:commandLink value="#{user.login}" style="font-family: Bell MT;"   title="View">

                </p:commandLink>
            </p:column>

            <p:column sortBy="#{user.nom}">
                <f:facet name="header">
                    <h:outputText value="Nom" style="font-family: Bell MT;" />
                </f:facet>
                <h:outputText value="#{user.nom}" style="font-family: Bell MT;" />
            </p:column>

            <p:column sortBy="#{user.prenom}">
                <f:facet name="header">
                    <h:outputText value="Prenom" style="font-family: Bell MT;"/>
                </f:facet>
                <h:outputText value="#{user.prenom}" style="font-family: Bell MT;"/>
            </p:column>

            <p:column sortBy="#{user.email}">
                <f:facet name="header">
                    <h:outputText value="Email" style="font-family: Bell MT;" />
                </f:facet>
                <h:outputText value="#{user.email}" style="font-family: Bell MT;" />
            </p:column>
            <f:facet name="footer">

            </f:facet>
        </p:dataTable>
    </h:form>

</ui:composition>